package a.j;

import javax.swing.*;
import java.awt.*;

class ge
  implements LayoutManager, ScrollPaneConstants
{
  protected og a;
  protected JScrollBar c;
  protected JScrollBar d;
  protected JComponent e;
  Dimension f = new Dimension(-1, -1);
  private JPanel h;
  
  protected Component a(Component paramComponent1, Component paramComponent2)
  {
    boolean bool = ld.E;
    if (!bool) {
      if (paramComponent1 != null)
      {
        if (bool) {
          break label30;
        }
        if (paramComponent1 != paramComponent2) {
          paramComponent1.getParent().remove(paramComponent1);
        }
      }
    }
    label30:
    return paramComponent2;
  }
  
  public void addLayoutComponent(String paramString, Component paramComponent)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!bool2) {
      if (paramString.equals("CANVAS"))
      {
        this.a = ((og)a(this.a, paramComponent));
        if ((!bool2) && (!bool1)) {
          return;
        }
      }
    }
    if (!bool2) {
      if (paramString.equals("VERTICAL_SCROLLBAR"))
      {
        this.c = ((JScrollBar)a(this.c, paramComponent));
        if ((!bool2) && (!bool1)) {
          return;
        }
      }
    }
    if (!bool2) {
      if (paramString.equals("HORIZONTAL_SCROLLBAR"))
      {
        this.d = ((JScrollBar)a(this.d, paramComponent));
        if ((!bool2) && (!bool1)) {
          return;
        }
      }
    }
    if (!bool2) {
      if (paramString.equals("CORNER_COMPONENT")) {
        this.e = ((JComponent)a(this.e, paramComponent));
      }
    }
    if ((bool2) || ((bool1) && ("GLASS_PANE".equals(paramString)))) {
      this.h = ((JPanel)paramComponent);
    }
  }
  
  public void removeLayoutComponent(Component paramComponent)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!bool2) {
      if (paramComponent == this.a)
      {
        this.a = null;
        if (!bool1) {
          return;
        }
      }
    }
    if (!bool2) {
      if (paramComponent == this.c)
      {
        this.c = null;
        if (!bool1) {
          return;
        }
      }
    }
    if (!bool2)
    {
      if (paramComponent == this.d)
      {
        this.d = null;
        if (!bool1) {
          return;
        }
      }
      if (bool2) {}
    }
    else if (paramComponent == this.e)
    {
      this.e = null;
      if (!bool1) {
        return;
      }
    }
    if (paramComponent == this.h) {
      this.h = null;
    }
  }
  
  public Dimension preferredLayoutSize(Container paramContainer)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    pg localpg = (pg)paramContainer;
    int i = localpg.o();
    int j = localpg.n();
    Insets localInsets = localpg.getInsets();
    int k = localInsets.left + localInsets.right;
    int m = localInsets.top + localInsets.bottom;
    Rectangle localRectangle = null;
    Dimension localDimension = null;
    if (this.a != null)
    {
      localRectangle = localpg.z();
      localDimension = this.a.getPreferredSize();
    }
    if (this.h != null)
    {
      if (!bool2) {
        if (localDimension != null)
        {
          if (bool2) {
            break label165;
          }
          localDimension.setSize(Math.max(localDimension.getWidth(), this.h.getPreferredSize().getWidth()), Math.max(localDimension.getHeight(), this.h.getPreferredSize().getHeight()));
          if (!bool1) {
            break label163;
          }
        }
      }
      localDimension = this.h.getPreferredSize();
    }
    label163:
    if (localDimension != null)
    {
      label165:
      k += localDimension.width;
      m += localDimension.height;
    }
    if (!bool2) {
      if ((this.c != null) && ((bool2) || (i != 21))) {
        if ((bool2) || (i == 22))
        {
          k += this.c.getPreferredSize().width;
          if (!bool1) {}
        }
        else if ((localDimension != null) && ((bool2) || (localRectangle != null)) && ((bool2) || (localRectangle.height > localDimension.height / localpg.M())))
        {
          k += this.c.getPreferredSize().width;
        }
      }
    }
    if (this.d != null) {
      if ((bool2) || (j != 31)) {
        if ((bool2) || (j == 32))
        {
          m += this.d.getPreferredSize().height;
          if (!bool1) {}
        }
        else
        {
          if (bool2) {
            break label421;
          }
          if ((localDimension != null) && ((bool2) || (localRectangle != null)) && ((bool2) || (localRectangle.width > localDimension.width / localpg.M()))) {
            m += this.d.getPreferredSize().height;
          }
        }
      }
    }
    label421:
    return new Dimension(k, m);
  }
  
  public Dimension minimumLayoutSize(Container paramContainer)
  {
    boolean bool = ld.E;
    pg localpg = (pg)paramContainer;
    int i = localpg.o();
    int j = localpg.n();
    Insets localInsets = localpg.getInsets();
    int k = localInsets.left + localInsets.right;
    int m = localInsets.top + localInsets.bottom;
    Dimension localDimension;
    if (!bool) {
      if (this.a != null)
      {
        localDimension = this.a.getMinimumSize();
        k += localDimension.width;
        m += localDimension.height;
      }
    }
    if (!bool)
    {
      if ((this.c != null) && (i != 21))
      {
        localDimension = this.c.getMinimumSize();
        k += localDimension.width;
        m = Math.max(m, localDimension.height);
      }
      if (bool) {}
    }
    else if (this.d != null)
    {
      if (j != 21)
      {
        localDimension = this.d.getMinimumSize();
        k = Math.max(k, localDimension.width);
        m += localDimension.height;
      }
    }
    if (this.h != null)
    {
      k = Math.max(k, this.h.getMinimumSize().width);
      m = Math.max(m, this.h.getMinimumSize().height);
    }
    return new Dimension(k, m);
  }
  
  public void layoutContainer(Container paramContainer)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    pg localpg = (pg)paramContainer;
    Rectangle localRectangle1 = new Rectangle(localpg.getSize());
    int i = 0;
    if (!bool2) {
      if (this.f.width == localRectangle1.width)
      {
        if (bool2) {
          break label90;
        }
        if (this.f.height == localRectangle1.height) {
          break label86;
        }
      }
    }
    i = 1;
    this.f.setSize(localRectangle1.width, localRectangle1.height);
    label86:
    label90:
    int j = localpg.o();
    int k = localpg.n();
    Insets localInsets = localpg.getInsets();
    localRectangle1.x = localInsets.left;
    localRectangle1.y = localInsets.top;
    localRectangle1.width -= localInsets.left + localInsets.right;
    if (!bool2)
    {
      localRectangle1.height -= localInsets.top + localInsets.bottom;
      if (i != 0)
      {
        if (bool2) {
          break label270;
        }
        if (localpg.m())
        {
          localRectangle2 = new Rectangle(localRectangle1);
          if (!bool2) {
            if (k == 32) {
              localRectangle2.height -= this.d.getPreferredSize().height;
            }
          }
          if (j == 22) {
            localRectangle2.width -= this.c.getPreferredSize().width;
          }
          this.a.setBounds(localRectangle2);
          this.a.j();
        }
      }
    }
    label270:
    Rectangle localRectangle2 = localpg.z();
    Dimension localDimension = localpg.getSize();
    double d1 = localpg.M();
    double d2 = 1.0D;
    Rectangle localRectangle3 = new Rectangle(0, localRectangle1.y, 0, 0);
    Point localPoint = localpg.R();
    if (!bool2)
    {
      if (j == 22)
      {
        m = 1;
        if ((!bool2) && (!bool1)) {
          break label431;
        }
      }
      if (bool2) {}
    }
    else if (j == 21)
    {
      m = 0;
      if ((!bool2) && (!bool1)) {
        break label431;
      }
    }
    if (!bool2) {
      if (localRectangle2.y + d2 >= localPoint.getY()) {
        if (bool2) {
          break label425;
        }
      }
    }
    label425:
    int m = localRectangle2.y + localRectangle2.height - d2 > localPoint.getY() + localDimension.height / d1 ? 1 : 0;
    label431:
    if ((this.c != null) && ((bool2) || (m != 0)))
    {
      int n = this.c.getPreferredSize().width;
      localRectangle1.width -= n;
      localRectangle1.x += localRectangle1.width;
      localRectangle3.width = n;
    }
    Rectangle localRectangle4 = new Rectangle(localRectangle1.x, 0, 0, 0);
    if (!bool2)
    {
      if (k == 32)
      {
        i1 = 1;
        if ((!bool2) && (!bool1)) {
          break label722;
        }
      }
      if (bool2) {}
    }
    else if (k == 31)
    {
      i1 = 0;
      if ((!bool2) && (!bool1)) {
        break label722;
      }
    }
    if (!bool2) {
      if (m != 0)
      {
        if (!bool2) {
          if (localRectangle2.x + d2 >= localPoint.getX()) {
            if (bool2) {
              break label637;
            }
          }
        }
        label637:
        i1 = localRectangle2.x + localRectangle2.width - d2 > localPoint.getX() + (localDimension.width - localRectangle3.width) / d1 ? 1 : 0;
        if ((!bool2) && (!bool1)) {
          break label722;
        }
      }
    }
    if (!bool2) {
      if (localRectangle2.x + d2 >= localPoint.getX()) {
        if (bool2) {
          break label716;
        }
      }
    }
    label716:
    int i1 = localRectangle2.x + localRectangle2.width - d2 > localPoint.getX() + localDimension.width / d1 ? 1 : 0;
    label722:
    if (!bool2)
    {
      if ((this.d != null) && ((bool2) || (i1 != 0)))
      {
        int i2 = this.d.getPreferredSize().height;
        localRectangle1.height -= i2;
        localRectangle1.y += localRectangle1.height;
        localRectangle4.height = i2;
        if (bool2) {
          break label963;
        }
        if ((this.c != null) && ((bool2) || (m == 0)) && ((bool2) || (j != 21)))
        {
          if (!bool2) {
            if (localRectangle2.y + d2 >= localPoint.getY()) {
              if (bool2) {
                break label884;
              }
            }
          }
          label884:
          m = localRectangle2.y + localRectangle2.height - d2 > localPoint.getY() + localRectangle1.height / d1 ? 1 : 0;
          if (bool2) {
            break label962;
          }
          if (m != 0)
          {
            int i3 = this.c.getPreferredSize().width;
            localRectangle1.width -= i3;
            localRectangle1.x += localRectangle1.width;
            localRectangle3.width = i3;
          }
        }
      }
      localRectangle3.height = localRectangle1.height;
      localRectangle4.width = localRectangle1.width;
    }
    label962:
    label963:
    if (!bool2)
    {
      if (this.a != null) {
        this.a.setBounds(localRectangle1);
      }
      if (bool2) {}
    }
    else if (this.e != null)
    {
      if (bool2) {
        break label1054;
      }
      if ((this.c != null) && (m != 0))
      {
        if (bool2) {
          break label1054;
        }
        if ((this.d != null) && (i1 != 0)) {
          this.e.setBounds(localRectangle1.width, localRectangle1.height, localRectangle3.width, localRectangle4.height);
        }
      }
    }
    label1054:
    if (!bool2)
    {
      if (this.h != null) {
        this.h.setBounds(localRectangle1);
      }
      localpg.p();
    }
    if (!bool2) {
      if (this.c != null)
      {
        if (!bool2)
        {
          if (m != 0)
          {
            this.c.setBounds(localRectangle3);
            if (bool2) {
              break label1138;
            }
            this.c.setVisible(true);
          }
        }
        else {
          if (!bool1) {
            break label1134;
          }
        }
        this.c.setVisible(false);
      }
    }
    label1134:
    if (this.d != null)
    {
      label1138:
      if (!bool2)
      {
        if (i1 != 0)
        {
          this.d.setBounds(localRectangle4);
          if (bool2) {
            break label1183;
          }
          this.d.setVisible(true);
        }
      }
      else if (!bool1) {
        return;
      }
      this.d.setVisible(false);
    }
    label1183:
  }
  
  public boolean a(Container paramContainer)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    pg localpg = (pg)paramContainer;
    int i = localpg.o();
    int j = localpg.n();
    Rectangle localRectangle1 = new Rectangle(localpg.getSize());
    Insets localInsets = localpg.getInsets();
    localRectangle1.x = localInsets.left;
    localRectangle1.y = localInsets.top;
    localRectangle1.width -= localInsets.left + localInsets.right;
    localRectangle1.height -= localInsets.top + localInsets.bottom;
    Rectangle localRectangle2 = localpg.z();
    Dimension localDimension = localpg.getSize();
    double d1 = localpg.M();
    Rectangle localRectangle3 = new Rectangle(0, localRectangle1.y, 0, 0);
    if (!bool2)
    {
      if (i == 22)
      {
        k = 1;
        if ((!bool2) && (!bool1)) {
          break label221;
        }
      }
      if (bool2) {}
    }
    else if (i == 21)
    {
      k = 0;
      if ((!bool2) && (!bool1)) {
        break label221;
      }
    }
    if (!bool2) {}
    int k = localRectangle2.height > localDimension.height / d1 ? 1 : 0;
    label221:
    if ((this.c != null) && ((bool2) || (k != 0)))
    {
      int m = this.c.getPreferredSize().width;
      localRectangle1.width -= m;
      localRectangle1.x += localRectangle1.width;
      localRectangle3.width = m;
    }
    Rectangle localRectangle4 = new Rectangle(localRectangle1.x, 0, 0, 0);
    int n = 0;
    if (!bool2)
    {
      if (j == 32)
      {
        n = 1;
        if ((!bool2) && (!bool1)) {
          break label443;
        }
      }
      if (bool2) {}
    }
    else if (j == 31)
    {
      n = 0;
      if ((!bool2) && (!bool1)) {
        break label443;
      }
    }
    if (!bool2) {
      if (k != 0)
      {
        if (!bool2) {}
        n = localRectangle2.width > (localDimension.width - localRectangle3.width) / d1 ? 1 : 0;
        if ((!bool2) && (!bool1)) {
          break label443;
        }
      }
    }
    if (!bool2) {}
    n = localRectangle2.width > localDimension.width / d1 ? 1 : 0;
    label443:
    if (this.d != null)
    {
      if (bool2) {
        break label575;
      }
      if (n != 0)
      {
        if (bool2) {
          break label575;
        }
        int i1 = this.d.getPreferredSize().height;
        localRectangle1.height -= i1;
        localRectangle1.y += localRectangle1.height;
        localRectangle4.height = i1;
        if (this.c != null)
        {
          if (bool2) {
            break label575;
          }
          if (k == 0)
          {
            if (bool2) {
              break label587;
            }
            if (i != 21)
            {
              if (!bool2) {}
              k = localRectangle2.height > localRectangle1.height / localpg.M() ? 1 : 0;
            }
          }
        }
      }
    }
    label575:
    if (!bool2) {
      if (k == this.c.isVisible()) {
        label587:
        if (bool2) {
          break label608;
        }
      }
    }
    label608:
    return n != this.d.isVisible();
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.ge

 * JD-Core Version:    0.7.0.1

 */